# *************************************************************
# *	@Hardware: TQ2416	
# *	@software: ubuntu-12.04
# *	@author	 : <mingllu@163.com>
# *	@date    : 2015-07-09
# *	@filename: led.S
# **************************************************************

BINANME = odf

DIR_INC = ./include 
DIR_ORDERS = ./lib_orders

CFLAGS += -I$(DIR_INC)

CROSS_COMPILE = /usr/local/arm-2014.05/bin/arm-none-linux-gnueabi-
CC 		= $(CROSS_COMPILE)gcc
LD 		= $(CROSS_COMPILE)ld
AR 		= $(CROSS_COMPILE)ar
OBJCOPY = $(CROSS_COMPILE)objcopy 
OBJDUMP = $(CROSS_COMPILE)objdump 
STRIP	= $(CROSS_COMPILE)strip 
READELF = $(CROSS_COMPILE)readelf 

SRC_C = $(wildcard *.c) $(wildcard $(DIR_ORDERS)/*.c)
OBJ_C = $(patsubst %.c,%.o,$(SRC_C)) 

OBJ_ALL = $(OBJ_C)

.PHONY:all 
all:$(OBJ_ALL)
	$(CC) -o $(BINANME) $(OBJ_ALL) -lpthread
	rm -rf *.o *.elf 
	cp -a $(BINANME) ~/nfs/rootfs/etc/rc.d/init.d/ 

%.o: %.c
	$(CC) $(CFLAGS) -c -o $@ $< 

clean:
	rm -rf *.elf *.o $(BINANME) $(DIR_ORDERS)/*.o


